package com.edu.cqr.web.demo.mapper;

import com.edu.cqr.web.demo.model.FreeRoomCelendar;
import com.edu.cqr.web.demo.model.RoomPrice;
import com.edu.cqr.web.demo.model.RoomType;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface FreeRoomCalendarMapper {
    int deleteByPrimaryKey(Long freeRoomCalendarNum);

    int insert(FreeRoomCelendar record);

    int insertSelective(FreeRoomCelendar record);

    FreeRoomCelendar selectByPrimaryKey(Long freeRoomCalendarNum);

    int updateByPrimaryKeySelective(FreeRoomCelendar record);

    int updateByPrimaryKey(FreeRoomCelendar record);

    List<FreeRoomCelendar> findFreeRoomByMinFreeCount(@Param("checkInDate") String checkInDate, @Param("checkOutDate") String checkOutDate);

    RoomType findRoomTypeByRoomTypeNum(@Param("roomTypeNum") Long roomTypeNum);

    RoomPrice findRoomPriceByRoomTypeNum(@Param("roomTypeNum") Long roomTypeNum);

    void updFreeCountByRoomCount(@Param("checkInDate") String checkInDate, @Param("checkOutDate") String checkOutDate, @Param("roomCount") Integer roomCount, @Param("roomTypeNum") Long roomTypeNum);
}
